package 排序2;

import java.util.Arrays;

public class Test {
    private static void initArraySort(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] = i;
        }
    }
    public static void  testShellSort(int []array) {
        array = Arrays.copyOf(array,array.length);
        long q1 = System.currentTimeMillis();
        Sort.ShellSort(array);
        long q2 = System.currentTimeMillis();
        System.out.println("希尔排序耗时"+(q2-q1));
    }
    public static void  testInsertSort(int []array) {
        array = Arrays.copyOf(array,array.length);
        long q1 = System.currentTimeMillis();
        Sort.InsertSort(array);
        long q2 = System.currentTimeMillis();
        System.out.println("直接插入排序耗时"+(q2-q1));
    }

    public static void main1(String[] args) {
        int[] array = new int[100_0000];
        initArraySort(array);
        testInsertSort(array);
        testShellSort(array);
    }



    public static void main(String[] args) {
        int []array = {12,32,51,14,36};
        Sort.ShellSort(array);
        System.out.println(Arrays.toString(array));
    }


}
